package com.hyt.it.ogt.main;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;

import com.hyt.it.ogt.pj.utils.MarkConfigProperties;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@MapperScan(basePackages = {"com.hyt.it.ogt.dict.mapper"})
@ComponentScan(basePackages = {"com.hyt"})
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
//@Import({DataSourceConfiguration.class})
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.hyt"})
@EnableHystrix
@EnableCaching
@ComponentScan(basePackages = {"com.hyt"})
@EnableConfigurationProperties(MarkConfigProperties.class)
public class AfterExamApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(AfterExamApplication.class, args);
        ConfigurableEnvironment environment = run.getEnvironment();
        log.info("swagger访问地址：http://localhost:{}/doc.html", environment.getProperty("server.port"));
    }
}
